<template>
    <div>
        <!--导航栏-->
        <router-link tag="div" class="header-wrapper" :to="isAuth === '1'?'/personInfo':'/real_name'">
            <div class="left">
                <div class="logo">
                    <img :src="isAuth==='1'?userInfo.headimgurl:require('@/assets/images/head_portrait.png')" class="avatar" alt="logo" />
                </div>
                <div class="headerFont">
                    <div class="name" v-if="isAuth === '1'">
                        <p>{{userInfo && userInfo.username.slice(0,1)}} {{userInfo.sex==='1'?"先生":userInfo.sex==='2'?"女士":""}}</p>
                        <p class="p2">已实名认证</p>
                    </div>
                    <div class="name" v-if="isAuth === '0'">
                        <p class="p2" @click="toAuth">点击实名认证</p>
                    </div>
                    <div class="coin_num">
                        <!-- <span class="coin_icon"></span> -->
                        <p>我的积分</p>
                        <p style="font-size:35px">{{currentNum}}</p>
                    </div>
                </div>
            </div>
            <div class="right">
                <router-link to="/coinDetail">
                    <img :src="coinDetail" alt="logo" style="margin-top:30px" />
                    <!-- <div class="coindet">积分明细</div> -->
                </router-link>
                <router-link tag="div" class="qrshare" to="/qrcodeShare">
                    <p>邀请海报</p>
                    <img src="@/assets/images/home/shareto.png" alt />
                </router-link>
            </div>
        </router-link>
        <div class="sign_toast" v-if="showsigntoast">
            <div class="toast_bg">
                <p class="fir">签到成功！积分已到账</p>
                <p class="sec">+2积分</p>
                <p class="thd" @click="thdtoast()">我知道了</p>
            </div>
        </div>
        <div class="head-cell">
            <p class="title">
                <span class="icon"></span>客户服务
            </p>
        </div>
        <div class="menu-wrapper">
            <router-link tag="div" class="item" to="/myOrder">
                <span class="icon my_order"></span>
                <p>我的订单</p>
            </router-link>
            <router-link tag="div" class="item" to="/mycoupon">
                <span class="icon coupon"></span>
                <p>我的权益</p>
            </router-link>
            <router-link tag="div" class="item" to="/points-exp?code=0">
                <span class="icon hot_new"></span>
                <p>积分规则</p>
            </router-link>
            <router-link tag="div" class="item" to="/points-exp?code=1">
                <span class="icon get_order"></span>
                <p>下单流程</p>
            </router-link>
            <router-link tag="div" class="item" to="/points">
                <span class="icon gift_mail"></span>
                <p>权益商城</p>
            </router-link>
            <router-link v-if="ismanager == 1" tag="div" class="item" to="/managerComfirm">
                <span class="icon manager"></span>
                <p>权益发放</p>
            </router-link>
            <!-- <router-link tag="div" class="item" to="/managerAd">
                <span class="icon managershare"></span>
                <p>秒杀分享</p>
            </router-link> -->
            <router-link tag="div" class="item" to="/managershare">
                <span class="icon managerrecord"></span>
                <p>我的邀请</p>
            </router-link>
        </div>

        <Tabbar />
    </div>
</template>

<script>
import Vue from 'vue';
import { Button, Dialog, Toast } from 'vant';
import { imgBaseUrl, baseUrl } from '@/config/env';
import weixin from '@/components/wx/wx.js';
import Tabbar from '@/components/tabbar';
// import moment from 'moment';
Vue.use(Dialog);
export default {
    data() {
        return {
            imgBaseUrl,
            animate: false,
            coinRule: require('@/assets/images/coin_rule.png'),
            coinDetail: require('@/assets/images/coinDetail1.png'),
            orderDetail: require('@/assets/images/order_circuit.png'),
            data: {},
            currentNum: '', // 当前积分
            userInfo: null,
            isAuth: null,
            couponLIst: [],
            hotList: [],
            actList: [],
            orderlsit: [],
            CouponNumList: [],
            showToa: true,
            ismanager: '',
            sign: '0',
            showsigntoast: false,
            answer: '0',
            isRight: ''
        };
    },
    mounted() {
        if (window.sessionStorage.getItem('toast') === 'key') {
            console.log(window.sessionStorage.getItem('toast'));
            this.showToa = false;
        }
        this.currentUserInfo();
        this.getCouponList();
        this.getHotProductList();
        this.initWxChat();
        this.getActlist();
        this.getOrderList();
        this.getCouponNum();
        // this.getsigiIn();
    },
    methods: {
        initWxChat() {
            const url = window.location.href.split('#')[0];
            const param = {
                title: '邮储银行厦门分行积分兑换活动',
                desc: '限量优惠券大放送，领券下单更优惠！',
                link:
                    baseUrl + 'entrance/goto?redir=' + window.location.href.split('#')[1],
                imgUrl:
                    'http://img.580travel.com/ticket/b9ed3290-db74-11e9-a515-c13cae82320b',
                localUrl: url
            };
            weixin.wxChat(this, param);
        },
        // 获取用户答题信息
        getanswer() {
            if (this.isAuth === '1') {
                this.$http.post('investigationQuestion/isAnswer').then(res => {
                    console.log(res);
                    if (res.data.code !== '0') {
                        this.answer = '1';
                        this.isRight = res.data.object.isRight;
                    } else {
                    }
                });
            }
        },
        // 获取签到信息
        getsigiIn() {
            if (this.isAuth === '1') {
                this.$http.post('tuser/signininfo').then(res => {
                    console.log(res);
                    if (res.data.object) {
                        this.sign = '1';
                    }
                });
            }
        },
        thdtoast() {
            this.showsigntoast = false;
            this.sign = '1';
        },
        // 答题
        toanswer() {
            if (this.isAuth === '0') {
                Dialog.confirm({
                    title: '提示',
                    message: '您还未实名认证',
                    cancelButtonText: '再看看',
                    confirmButtonText: '去认证'
                })
                    .then(() => {
                        this.$router.replace('/real_name');
                    })
                    .catch(() => { });
            } else {
                this.$http.post('investigationQuestion/isAnswer').then(res => {
                    console.log(res);
                    if (res.data.code === '0') {
                        this.$router.push('/dayanwser');
                    } else {
                        Toast(res.data.message);
                    }
                });
            }
        },
        // 签到
        tosignIn() {
            if (this.isAuth === '0') {
                Dialog.confirm({
                    title: '提示',
                    message: '您还未实名认证',
                    cancelButtonText: '再看看',
                    confirmButtonText: '去认证'
                })
                    .then(() => {
                        this.$router.replace('/real_name');
                    })
                    .catch(() => { });
            } else {
                this.$http.post('/tuser/signin').then(res => {
                    console.log(res);
                    if (res.data.code === '0') {
                        this.showsigntoast = true;
                    } else {
                        Toast(res.data.message);
                    }
                });
            }
        },
        // 获取单张优惠券
        getCoupon(item) {
            if (this.isAuth === '0') {
                Dialog.confirm({
                    title: '提示',
                    message: '您还未实名认证',
                    cancelButtonText: '再看看',
                    confirmButtonText: '去认证'
                })
                    .then(() => {
                        this.$router.replace('/real_name');
                    })
                    .catch(() => { });
            } else {
                console.log(item);
                Dialog.confirm({
                    confirmButtonColor: '#28b46a',
                    // title: '提示',
                    message:
                        '您将使用' +
                        item.coin +
                        '积分领取该优惠券,该优惠券仅可在邮储银行卡支付下使用，您确定领取该优惠券吗?'
                }).then(() => {
                    // if (moment().isBefore('2019-12-21')) {
                    this.$http
                        .post('/tuserCoupon/add', { couponId: item.id.toString() })
                        .then(res => {
                            console.log(res);
                            if (res.data.code === '0') {
                                Dialog.alert({
                                    confirmButtonColor: '#28b46a',
                                    title: '提示',
                                    message: '您成功领取该优惠券,可在我的优惠券中查看'
                                }).then(() => {
                                    this.currentUserInfo();
                                    this.getCouponList();
                                });
                            } else {
                                Dialog.alert({
                                    confirmButtonColor: '#28b46a',
                                    title: '提示',
                                    message: res.data.message
                                }).then(() => {
                                    this.currentUserInfo();
                                    this.getCouponList();
                                });
                            }
                        });
                    // } else {
                    //   Dialog.alert({
                    //     confirmButtonColor: '#28b46a',
                    //     title: '提示',
                    //     message:
                    //       '邮储积分兑换活动已于2019年12月20日结束，已兑换产品请于2019年12月31日前核销，来不及核销的产品请自行保存好卡号卡密等关键信息，本活动链接将于2019年12月31日后开始升级，升级后所有记录清零！'
                    //   }).then(() => {
                    //     this.currentUserInfo();
                    //     this.getCouponList();
                    //   });
                    // }
                });
            }
        },
        // 获取用户信息
        currentUserInfo() {
            this.$http.post('/tuser/userInfo', {}).then(res => {
                if (res) {
                    if (res.data.code === '0') {
                        this.userInfo = res.data.object;
                        this.currentNum = res.data.object.coinAmount;
                        this.isAuth = res.data.object.isAuth;
                        this.ismanager = res.data.object.isManager;
                        console.log(this.isAuth);
                        this.getsigiIn();
                        this.getanswer();
                    }
                }
            });
        },
        getCouponList() {
            this.$http.post('/coupon/list', { pageSize: 1000 }).then(res => {
                if (res.data.list.length > 0) {
                    this.couponLIst = res.data.list;
                }
            });
        },
        getHotProductList() {
            this.$http.post('/product/hotList').then(res => {
                this.hotList = res.data.object;
            });
        },
        toAuth() {
            this.$router.push('/real_name');
        },
        toProduct(item) {
            if (this.isAuth === '0') {
                Dialog.confirm({
                    title: '提示',
                    message: '您还未实名认证',
                    cancelButtonText: '再看看',
                    confirmButtonText: '去认证'
                })
                    .then(() => {
                        this.$router.replace('/real_name');
                    })
                    .catch(() => { });
            } else {
                this.$router.push({
                    path: item.buyLimit === 0 ? '/error' : '/points/detail',
                    query: { id: item.id }
                });
            }
        },
        getActlist() {
            this.$http.post('/activity/list').then(res => {
                console.log(res);
                this.actList = res.data.list;
            });
        },
        toActlist(items) {
            this.$router.push('/' + items.url);
        },
        getOrderList() {
            this.$http.post('/order/list', {}).then(res => {
                // console.log(res.data.list.length);
                this.orderlsit = res.data.list;
            });
        },
        getCouponNum() {
            this.$http.post('/tuserCoupon/list', {}).then(res => {
                console.log(res);
                this.CouponNumList = res.data.list;
            });
        },
        toActivity() {
            this.$router.push('/turntableCoin');
            window.sessionStorage.setItem('toast', 'key');
        },
        activityImg() {
            this.showToa = false;
            window.sessionStorage.setItem('toast', 'key');
        }
    },
    components: {
        'van-button': Button,
        Tabbar
    }
};
</script>

<style lang="scss" scoped>
.header-wrapper {
  position: relative;
  height: 400px;
  // background-image: linear-gradient(163deg, #26a1f1 40%, #4388ef 100%);
  background-image: url('../../assets/images/bg.png');
  background-size: 100% 100%;
  display: flex;
  flex-direction: column;
  // align-items: center;
  .signin-tag {
    width: 162px;
    background-color: #ffc400;
    border-radius: 25px 0 0 25px;
    @include sc(26px, #454545);
    position: absolute;
    right: 0;
    top: 20px;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    text-indent: 12px;
  }
  .left {
    width: 700px;
    height: 141px;
    margin-left: 38px;
    margin-top: 20px;
    display: flex;
    // justify-content: space-around;
    // align-items: center;
    flex-direction: row;
    .logo {
      float: left;
      width: 80px;
      height: 80px;
      margin-right: 30px;
      img {
        width: 141px;
        display: block;
        border-radius: 50%;
      }
    }
    .headerFont {
      width: 370px;
      align-items: center;
      @include sc(26px, #fff);
      .name {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-top: 15px;
        .p2 {
          width: 165px;
          font-size: 22px;
          padding: 6px 7px;
          border: 1px solid #fff;
          border-radius: 8px;
          text-align: center;
          margin-left: 20px;
        }
      }
      .total {
        width: 100%;

        @include sc(26px, #fff);
        margin-top: 30px;
      }
      .coin_num {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        position: absolute;
        top: 190px;
        left: 30px;
        // margin-top: 55px;
        // margin-left: -450px;
        .coin_icon {
          display: block;
          width: 40px;
          height: 40px;
          margin-right: 10px;
          background-image: url(../../assets/images/star.png);
          background-size: 100% 100%;
          font-size: 30px;
        }
        p {
          font-size: 30px;
        }
      }
    }
  }
  .right {
    position: absolute;
    right: 0px;
    top: 50px;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: space-between;
    .coindet {
      width: 150px;
      height: 45px;
      background-color: #feed62;
      color: red;
      line-height: 49px;
      text-align: center;
      border-radius: 25px;
    }
    a {
      display: block;
      margin: 10px 0;
      img {
        width: 163px;
      }
    }
  }
}
.signIn {
  width: 700px;
  height: 142px;
  background-color: #ffffff;
  box-shadow: 0px -1px 16px 0px rgba(6, 0, 1, 0.12);
  border-radius: 20px;
  position: relative;
  top: -50px;
  left: 25px;
  display: flex;
  align-content: center;
  flex: 1;
  .line {
    width: 2px;
    height: 70px;
    margin-top: 30px;
    background-color: #f0f0f0;
  }
  .item {
    display: flex;
    flex: 0.5;
    justify-content: space-around;
    align-items: center;
    .img1 {
      height: 70px;
    }
    .img2 {
      height: 27px;
    }
    .firtext {
      font-size: 30px;
      color: #333333;
    }
    .sectext {
      font-size: 22px;
      letter-spacing: 1px;
      color: #fd6500;
    }
  }
}
.sign_toast {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  .toast_bg {
    width: 476px;
    height: 524px;
    background-size: 100% 100%;
    background-image: url(../../assets/images/answer/toast.png);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    .fir {
      margin-top: 285px;
      font-size: 32px;
      color: #ffffff;
    }
    .sec {
      font-size: 34px;
      letter-spacing: 2px;
      color: #fafd01;
    }
    .thd {
      width: 380px;
      height: 69px;
      background-color: #ffcd2f;
      border-radius: 35px;
      font-size: 30px;
      color: #000000;
      text-align: center;
      line-height: 69px;
      margin-top: 20px;
    }
  }
}
.myMessage {
  width: 710px;
  height: 199px;
  background-color: #ffffff;
  border-radius: 10px;
  position: absolute;
  top: 360px;
  align-self: center;
}
.myList {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: 42px;
  .line {
    width: 1px;
    height: 30px;
    background-color: #fff;
  }
  .list_item {
    width: 249px;
    text-align: center;
    :first-child {
      font-size: 40px;
      color: #fff;
    }
    :nth-child(2) {
      font-size: 24px;
      color: #fff;
    }
  }
}
.integral-wrapper {
  height: 150px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  .left {
    display: flex;
    min-width: 248px;
    align-items: center;
    flex-direction: column;
    // background-image: url(../../assets/images/more-arrows.png);
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 20px;
    .number {
      color: #000000;
      font-size: 38px;
    }
    .txt {
      color: #989898;
      font-size: 28px;
    }
  }
  .right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 341px;
    height: 70px;
  }
  .signBtn {
    width: 160px;
    height: 70px;
    line-height: 70px;
    text-align: center;
    font-size: 26px;
    background-color: #3889ff;
    border-radius: 8px;
    border: none;
    color: #ffffff;
  }
  .integral {
    width: 160px;
    height: 70px;
    background-color: white;
    border: 1px solid #3889ff;
    border-radius: 8px;
    color: #3889ff;
    font-size: 26px;
    text-align: center;
    line-height: 70px;
  }
}
.head-cell {
  height: 75px;
  background-color: #ffffff;
  padding: 0 25px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #ebebeb;
  // margin-top: -50px;
  .title {
    color: #454545;
    font-size: 30px;
    .icon {
      width: 31px;
      height: 32px;
      display: inline-block;
      @include bis('../../assets/images/customer_service.png');
      vertical-align: sub;
      margin-right: 15px;
    }
  }
  .right {
    display: flex;
    align-items: center;
    a {
      color: #454545;
      font-size: 30px;
      float: left;
    }
    img {
      margin-left: 5px;
      height: 25px;
      color: #ccc;
    }
  }
}
.menu-wrapper {
  width: 750px;
  min-height: 199px;
  border-radius: 10px;
  background-color: #ffffff;
  display: flex;
  // margin-left: 20px;
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  // margin-bottom: 30px;
  // position: absolute;
  // top: 350px;
  justify-content: flex-start;
  .item {
    width: 20%;
    // min-width: 187.5px;
    height: 167px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    .hot {
      width: 50px;
      position: absolute;
      top: 0;
      right: 10px;
    }
    img {
      height: 53px;
      margin-bottom: 20px;
    }
    .icon {
      width: 82px;
      height: 82px;
      background-size: 100% 100%;
      background-repeat: no-repeat;
      margin-bottom: 20px;
      &.act {
        background-image: url(../../assets/images/act.png);
      }
      &.my_order {
        background-image: url(../../assets/images/my_order.png);
      }
      &.coupon {
        background-image: url(../../assets/images/coupon.png);
      }
      &.hot_new {
        background-image: url(../../assets/images/hot_new.png);
      }
      &.get_order {
        background-image: url(../../assets/images/home/linc.png);
      }
      &.gift_mail {
        background-image: url(../../assets/images/gift_mail.png);
      }
      &.manager {
        background-image: url(../../assets/images//home/manager.png);
      }
      &.managershare {
        background-image: url(../../assets/images//seckill/miaoshaicon.png);
      }
      &.managerrecord {
        background-image: url(../../assets/images//seckill/myshare.png);
      }
    }
    p {
      color: #454545;
      font-size: 26px;
    }
  }
}
.cover {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  padding-left: 18px;
  padding-right: 17px;
  .middleBox {
    width: 10rem;
    margin: 0 auto;
    height: 586px;
    .signImg {
      width: 100%;
      height: 280px;
      .ImgSize {
        height: 306px;
      }
    }
    .signFooter {
      width: 511px;
      height: 300px;
      margin: 0 auto;
      background-color: #ffffff;
      border-radius: 30px;
      display: flex;
      align-items: center;
      flex-direction: column;
      .signFooterOne {
        width: 318px;
        height: 42px;
        color: #020202;
        font-size: 34px;
        letter-spacing: 2px;
        margin-top: 71px;
      }
      .signFooterTwo {
        width: 450px;
        height: 88px;
        background-color: #3889ff;
        border-radius: 8px;
        color: #ffffff;
        font-size: 32px;
        border: none;
        margin-top: 71px;
      }
    }
  }
}
.secret-popup {
  padding: 20px;
  p {
    padding: 20px;
  }
}
.info-wrapper {
  width: 690px;
  box-shadow: 0px 1px 10px 0px rgba(181, 184, 185, 0.75);
  border-radius: 20px;
  height: 120px;
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px;
  margin: -20px auto 20px;
  position: relative;
  z-index: 2;
  .left {
    display: flex;
    align-items: center;
    .info {
      border-right: 1px solid #ebebeb;
      padding-right: 30px;
      margin-right: 30px;
    }
    .num {
      font-size: 24px;
      color: #626262;
    }
    .exp {
      @include sc(28px, #626262);
    }
  }
  .right {
    height: 60px;
    text-align: center;
    line-height: 60px;
    background-image: linear-gradient(270deg, #4388ef 0%, #26a1f1 100%);
    border-radius: 8px;
    font-size: 28px;
    color: #fff;
    padding: 0 12px;
  }
}
.member {
  font-size: 28px;
  color: #454545;
  margin-bottom: 16px;
  .member-icon {
    width: 46px;
    height: 46px;
    margin-right: 5px;
    display: inline-block;
    vertical-align: bottom;
    background-image: url('../../assets/images/vip_icon.png');
    background-repeat: no-repeat;
    background-size: 313px;
    &.vip1 {
      background-position: 0 -50px;
    }
    &.vip2 {
      background-position: -90px -50px;
    }
    &.vip3 {
      background-position: -172px -50px;
    }
    &.vip4 {
      background-position: -252px -50px;
    }
  }
}
.featured-wrapper {
  display: flex;
  background-color: #fff;
  justify-content: center;
  margin-bottom: 30px;
  .item {
    min-width: 333px;
    height: 260px;
    position: relative;
    display: flex;
    padding: 20px 25px;
    flex-direction: row;
    border-right: 1px solid #ebebeb;
    display: flex;
    flex: 1;
    &:last-child {
      border-right: none;
    }
    .icon {
      margin-right: 11px;
      height: 33px;
      vertical-align: text-top;
    }
    .name {
      font-size: 30px;
      color: #363636;
    }
    .desc {
      font-size: 24px;
      color: #9b9b9b;
    }
    .left-goods {
      position: absolute;
      bottom: 20px;
      left: 20px;
      .pic {
        width: 151px;
        height: 80px;
      }
      .name {
        font-size: 20px;
        color: #9b9b9b;
        width: 151px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-top: 15px;
      }
    }
    .right-goods {
      width: 144px;
      height: 144px;
      position: absolute;
      right: 25px;
      bottom: 20px;
    }
  }
}

.coin-push {
  height: 75px;
  background-color: #ffffff;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 30px;
  border-bottom: 1px solid #ebebeb;
  .title {
    font-size: 30px;
    color: #454545;
    margin-right: 50px;
  }
}
.scroll-wrap {
  width: 350px;
  height: 60px;
  display: flex;
  flex: 1;
  overflow: hidden;
  .icon {
    line-height: 1;
    display: inline-block;
    padding: 6px 8px;
    border-radius: 5px;
    color: #fff;
    background-color: #f30008;
  }
  .scroll-content {
    height: 60px;
    overflow: hidden;
    li {
      font-size: 26px;
      text-align: center;
      line-height: 60px;
      a {
        color: #4d4d4d;
      }
    }
    &.marquee_top {
      transition: all 0.4s;
      margin-top: -55px;
    }
  }
}
.goods-wrapper {
  background-color: #fff;
  margin-bottom: 30px;
  .head {
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid #f2f2f2;
    .title-icon {
      height: 42px;
    }
  }
}

.coin-wrapper {
  width: 100%;
  overflow: hidden;
}
.coin-list {
  margin-top: 20px;

  .gift-item {
    display: inline-block;
    width: 232px;
    // height: 413px;
    background-color: #ffffff;
    box-shadow: 0 0 10px #cecece;
    position: relative;
    margin-bottom: 20px;
    margin-left: 22px;
    &:last-child {
      border-bottom: none;
    }
    .gift-pic {
      height: 227px;
      display: flex;
      align-items: center;
      justify-content: center;
      .pic {
        width: 100%;
        height: 100%;
      }
    }
    .info {
      padding: 0 10px;
      .name {
        font-size: 19px;
        color: #000000;
        font-weight: 400;
        min-height: 58px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        word-break: break-all;
        margin: 15px 0 0;
      }
      .num {
        color: #ff010d;
        font-size: 18px;
        display: flex;
        align-items: center;
        .limit {
          height: 20px;
          margin-right: 10px;
        }
        span {
          font-size: 18px;
        }
      }
      p {
        font-size: 16px;
        color: #8b8a8a;
      }
      del {
        font-size: 16px;
        color: #8b8a8a;
        display: block;
        height: 25px;
      }
    }
    .exchange-btn {
      position: absolute;
      right: 10px;
      bottom: 15px;
      background-color: #fff;
      color: #3889ff;
      border: 1px solid #3889ff;
      border-radius: 8px;
      font-size: 18px;
      display: inline-block;
      &.no-stock {
        color: #fff;
        border: 1px solid #b7b6b7;
        background-color: #b7b6b7;
      }
    }
  }
}
.mask {
  position: fixed;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 99;
}
.confirm-popup {
  text-align: center;
  padding: 30px;
  width: 528px;
  position: relative;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  border-radius: 20px;
  padding-bottom: 100px;
  padding-top: 181px;
  background-image: url('http://img.580travel.com/image/bocm/workerprize/back.png');
  background-size: 100%;
  background-repeat: no-repeat;
  margin-left: -10px;
  p {
    font-size: 44px;
    color: #030303;
    text-align: center;
    text-indent: 50px;
  }
  .btn {
    width: 330px;
    height: 80px;
    background-color: #3889ff;
    border-radius: 40px;
    font-size: 36px;
    color: #ffffff;
    border: none;
    margin-top: 368px;
    margin-left: 30px;
  }
  .close-icon {
    width: 50px;
    height: 50px;
    background-image: url('http://img.580travel.com/image/bocm/workerprize/closeico.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    display: inline-block;
    position: absolute;
    right: -20px;
    top: -60px;
    cursor: pointer;
  }
}
.rule-tips {
  @include bis('../../assets/images/rule_tips.png');
  width: 127px;
  height: 127px;
  position: fixed;
  right: 20px;
  bottom: 120px;
  z-index: 3;
  // animation: fit 1.2s ease-in-out 0.5s infinite alternate;
}
@keyframes fit {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(5px, 70px);
  }
}
.gift-ul {
  background-color: #ffffff;
  display: flex;
  flex-wrap: wrap;
  .gift-item {
    display: flex;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #ebebeb;
    position: relative;
    padding: 36px 30px;
    &:last-child {
      border-bottom: none;
    }
    .gift-pic {
      height: 210px;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      .pic {
        height: 100%;
        width: 100%;
      }
    }
    .info {
      padding: 0 20px;
      .name {
        @include sc(28px, #000);
        line-height: 38px;
        font-weight: 400;
        padding-bottom: 16px;
        max-height: 75px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        word-break: break-all;
        margin: 6px 0 0;
        width: 446px;
      }
      .sku {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        p {
          display: flex;
          align-items: center;
          justify-content: center;
          // width: 72px;
          // height: 35px;
          border-radius: 3px;
          border: solid 1px #fc0208;
          font-size: 18px;
          color: #fc0208;
          line-height: 30px;
          text-align: center;
          margin-left: 10px;
          margin-top: 10px;
        }
      }
      .num {
        @include sc(28px, #ff010d);
        display: flex;
        align-items: center;
        .limit {
          height: 32px;
          margin-left: 10px;
        }
        span {
          font-size: 28px;
        }
      }
      p {
        @include sc(24px, #8b8a8a);
      }
      del {
        @include sc(24px, #8b8a8a);
        display: block;
        height: 30px;
      }
    }
    .exchange-btn {
      position: absolute;
      right: 10px;
      bottom: 16px;
      width: 180px;
      height: 55px;
      line-height: 50px;
      background-color: #28b46a;
      border: 1px solid #28b46a;
      border-radius: 8px;
      @include sc(22px, #fff);
      &.no-stock {
        color: #fff;
        background-color: #fff;
        border: 1px solid #b7b6b7;
        background-color: #b7b6b7;
      }
    }
  }
}
.product_hot {
  position: relative;
  .hot_img {
    position: fixed;
    top: 800px;
    left: 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    img {
      width: 130px;
      margin-top: 20px;
    }
  }
}
.head-wrapper {
  height: 75px;
  background-color: #fff;
  padding: 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  @include sc(30px, #454545);
  border-bottom: 2px solid #ebebeb;
  .get_center {
    font-size: 30px;
    color: #454545;
    // margin-right: 50px;
    // font-weight: bold;
  }
  .icon {
    width: 32px;
    height: 32px;
    display: inline-block;
    @include bis('../../assets/images/recommend.png');
    vertical-align: sub;
    margin-right: 15px;
  }
  .coupon_icon {
    width: 45px;
    height: 35px;
    display: inline-block;
    @include bis('../../assets/images/coupon.png');
    vertical-align: sub;
    // margin-right: 15px;
  }
  .coupon_icon_one {
    width: 45px;
    height: 35px;
    display: inline-block;
    @include bis('../../assets/images/my_order.png');
    vertical-align: sub;
    // margin-right: 15px;
  }
  .more {
    color: #28b46a;
    background-image: url('../../assets/images/more-arrows.png');
    background-repeat: no-repeat;
    background-size: 13px;
    padding-right: 25px;
    background-position: center right;
  }
}
.couponList {
  margin-bottom: 30px;
  background-color: white;
  height: 444px;
  margin-top: 30px;
  .van_swipe_item {
    height: 369px;
    background-color: white;
    white-space: nowrap;
    overflow: scroll;
    // padding: 18px 0 18px 0;
    .swipe_item_img {
      width: 460px;
      background-size: 100% 100%;
      overflow: hidden;
      margin: 0 0 0 15px;
      display: inline-block;
      margin-top: 30px;
      .item {
        margin-top: 20px;
        :first-child {
          font-size: 24px;
        }
        :nth-child(2) {
          font-size: 20px;
          padding-top: 10px;
          color: #424242;
        }
      }
    }
    .swipe_item {
      width: 210px;
      height: 305px;
      background-size: 100% 100%;
      overflow: hidden;
      margin: 0 0 0 5px;
      display: inline-block;
      margin-top: 30px;
      .coupon_info {
        height: 222px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        color: white;
        margin-top: 10px;
        span {
          font-size: 20px;
        }
        .num {
          font-size: 74px;
          // margin-top: 51px;
          line-height: 55px;
          margin-bottom: 16px;
        }
        .condition {
          font-size: 22px;
          margin-bottom: 10px;
        }
        .coupon_type {
          height: 25px;
          line-height: 25px;
        }
      }
      .toGet {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        span {
          color: #28b46f;
          font-size: 26px;
        }
        p {
          color: #959595;
          font-size: 20px;
        }
      }
    }
    .coupon_bg1 {
      background-image: url(../../assets/images/coupon_bg_blue.png);
    }
    .coupon_bg2 {
      background-image: url(../../assets/images/coupon_bg_orange.png);
    }
    .coupon_bg3 {
      background-image: url(../../assets/images/coupon_bg_green.png);
    }
    .coupon_bg4 {
      background-image: url(../../assets/images/coupon_bg_pink.png);
    }
    .coupon_bg5 {
      background-image: url(../../assets/images/coupon_bg_purpose.png);
    }
  }
}
.act_toast {
  position: fixed;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  .toast_item {
    width: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    .toast_img {
      width: 100%;
    }
  }
}
footer {
  text-align: center;
  padding: 20px;
  color: #a5a5a5;
}
.qrshare {
  width: 130px;
  height: 130px;
  position: absolute;
  top: 143px;
  left: -300px;
  display: flex;
  flex-direction: column;
  // justify-content: center;
  align-items: center;
  img {
    width: 60px;
    height: 60px;
  }
  p {
    font-size: 30px;
    text-align: center;
    color: #ffffff;
    padding-bottom: 17px;
  }
}
</style>
